<?php

class WxappService {
  public function section_get($appid, $appSecret, $code) {
    $response = cmf_curl_get("https://api.weixin.qq.com/sns/jscode2session?appid=$appId&secret=$appSecret&js_code=$code&grant_type=authorization_code");
    $response = json_decode($response, true);
    if (!empty($response['errcode'])) {
        return '操作失败！';
    }

    return $response;
  }
}
